<#include "../../inc/header.ftl" />
<#import "/META-INF/spring.ftl" as spring />
<#import "/META-INF/mspring.ftl" as mspring />
<div id="error" class="message error" style="display:none;"></div>
<form class="form" id="forumForm" action="${base}/admin/bbs/forum/edit/save" method="POST">
	<@spring.bind "forum" />
	<@spring.formHiddenInput path="forum.id" />
	<table class="formtable" style="width:100%">
		<tr>
			<td class="fieldlabel" style="width:60px;">编号:</td>
			<td>
				<@spring.formInput path="forum.id" attributes='class="textinput" style="width:98%;" disabled="disabled"' defaultValue="自动生成" />
			</td>
		</tr>
		<tr>
			<td class="fieldlabel" style="width:60px;">分类:</td>
			<td>
				<@spring.formSingleSelect path="forum.catalog.id" options=forumCatalogs has_default=true attributes='validate=\'{required:true, messages:{required:"请选择版块分类"}}\' style="width:99%"'/>
			</td>
		</tr>
		<tr>
			<td class="fieldlabel" style="width:60px;">名称</td>
			<td>
				<@spring.formInput path="forum.name" attributes='class="textinput" style="width:98%;" validate=\'{maxlength:30, required: true, messages:{maxlength:"版块名称长度最大不能超过{0}", required:"请输入版块名称"}}\'' />
			</td>
		</tr>
		<tr>
			<td class="fieldlabel" style="width:60px;">排序</td>
			<td>
				<@spring.formInput path="forum.order" attributes='class="textinput" style="width:98%;" validate=\'{digits: true, range:[1,100], messages:{digits:"排序号码必须为正整数", range:"排序号码值范围必须在{0}到{1}之间"}}\'' />
			</td>
		</tr>
		<tr>
			<td class="fieldlabel" style="width:60px;">描述</td>
			<td>
				<@spring.formTextarea path="forum.description" attributes='class="textinput" style="width:98%;" validate=\'{maxlength:200, messages:{maxlength:"描述最大长度不能超过{0}"}}\'' />
			</td>
		</tr>
		<tr>
			<td colspan="4" style="text-align:center;">
				<input type="submit" class="btn" value=" 提交 " />
			</td>
		</tr>
	</table>
</form>

<script type="text/javascript">
	$(document).ready(function(){
		//斑马线
		var tables=document.getElementsByTagName("table");
		var b=false;
		for (var j = 0; j < tables.length; j++){
			var cells = tables[j].getElementsByTagName("tr");
			//cells[0].className="color3";
			b=false;
			for (var i = 0; i < cells.length; i++){
				if(b){
					cells[i].className="color2";
					b=false;
				}
				else{
					cells[i].className="color3";
					b=true;
				};
			};
		}
		
		mlog.form.validate({
			selector : "#forumForm",
			errorLabelContainer : "#error",
			wrapper: 'li',
			onfocusout : false,
			onkeyup : false,
			onclick : false,
			success : function(){
				mlog.utils.scrollTop();
			}
		});
		
	});
</script>
<#include "../../inc/footer.ftl" />